23.3 Customizing SpringApplication(定制SpringApplication)
1 | If the SpringApplication defaults are not to your taste, you can instead |
如果SpringApplication默认设置不符合您的口味,您可以创建一个本地实例替换定制它。举个例子,想要关闭banner您可以这样写:
1 | public static void main(String[] args) { |
1 | The constructor arguments passed to SpringApplication are |
传递给SpringApplication的构造函数参数是Spring bean的配置源。在大多数情况下,这将会关联到一个@Configuration的配置类,但它同样支持关联到XML配置或者关联到那些需要被扫描的包。1
2
3It is also possible to configure the SpringApplication by
using an application.properties file. See Chapter 24, Externalized Configuration for details.
For a complete list of the configuration options, see the SpringApplication Javadoc.
同样可以使用application.properties来配置SpringApplication。细节请查看章节24“Externalized Configuration ”。
需要了解完整的可选配置,请查看SpringApplication的Javadoc或者源码。